Polymorphic Templates: A design pattern for implementing agile model-to-text transformations
نویسندگان
چکیده
Model-to-text transformations are often used to produce source code, documentation or other textual artefacts from models. A common way of implementing them is using template languages. Templates are easy to read and write, however, they tend to become long and complex as the complexity of the metamodel grows. This paper proposes a design pattern that allows for the decomposition of complex templates with branching and conditions inside into simpler ones. Its main idea is that the code generator does not know about the concrete templates that are called: they are determined by the objects of the model being traversed. The concrete template is selected through object-oriented polymorphism. The pattern results in a flexible code generator with simple templates, good extensibility and separation of concerns. This agility facilitates the design for extension and changes, which is paramount nowadays.
منابع مشابه
Supply chain network design problem for a new market opportunity in an agile manufacturing system
The characteristics of today's competitive environment, such as the speed with which products are designed, manufactured, and distributed, and the need for higher responsiveness and lower operational cost, are forcing companies to search for innovative ways to do business. The concept of agile manufacturing has been proposed in response to these challenges for companies. This ...
متن کاملTowards an Agent-driven Software Architecture Aligned with User Stories
Agile principles have taken an increasing importance in the last decades. Software Architecture (SA) definition is perceived as a non-agile practice as it is executed in a top-down manner, reminding waterfall development, and sometimes imposes heavy documentation. This paper proposes to systematically build an agent-oriented SA from a set of User Stories (US), the core artifact to document requ...
متن کاملImplementing Digital Enterprise Technologies for Agile Design in the virtual enterprise
The full-text may be used and/or reproduced, and given to third parties in any format or medium, without prior permission or charge, for personal research or study, educational, or not-for-pro t purposes provided that: • a full bibliographic reference is made to the original source • a link is made to the metadata record in DRO • the full-text is not changed in any way The full-text must not be...
متن کاملXm 2013 – Extreme Modeling Workshop Proceedings Program Committee Supporting Agility in Mde through Modeling Language Relaxation . . . . . . . . . . . 21 Keynote Agile versus Mde -friend or Foe?
In this paper we demonstrate how diagrams constructed using general-purpose drawing tools in the context of agile language development processes can be annotated and consumed by model management programs (such as simulators, model-to-model and model-to-text transformations). The aim of this work is to enable engineers to engage in programmatic model management early in the language development ...
متن کاملSoftware Engineering by Source Transformation-Experience with TXL
Many tasks in software engineering can be characterized as source to source transformations. Design recovery, software restructuring, forward engineering, language translation, platform migration and code reuse can all be understood as transformations from one source text to another. TXL, the Tree Transformation Language, is a programming language specifically designed to support rule-based sou...
متن کامل